package com.bootcamp.javase.basic1;

/**
 * @program: BlockCode
 * @description:
 * @author: Keyu Li
 * @create: 2021-08-30 19:04
 **/

public class Demo {
    public static void main(String[] args) {
        //注意不要同时放开两个new语句，避免互相影响
        //debug语句一，可以进入查看age的赋值过程
        //Person p = new Person2(18);
        //debug语句二，进入查看nationality赋值过程
        Person2 p2 = new Person2("china");
    }
}
class Person2 {
    int age = 10;
    static String nationality = "america"; //类加载

    public Person2(int age) {
        this.age = age;
    }


    public Person2() {
    }

    public Person2(String nationality) {
        Person2.nationality = nationality; //创建对象
    }
}
